package czy.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {

    @GetMapping("/novisit")
    public String novisit(){
        return "success";
    }

    /**
     * @RequestAttribute注解可以获取请求属性,一般在拦截器中加入属性
     */
    @GetMapping("/canvisit")
    public String canvisit(@RequestAttribute String param){
        System.out.println("获取到请求属性param="+param);
        return "success";
    }

}
